﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonEmpAudit.aspx.cs"
    Inherits="RN.ERP.Web.Person.PersonEmpAudit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
        <%=PageTitle %></title>
    <link href="../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/skins/blue/css/style_msg.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" language="javascript" src="../Scripts/json-data.js"></script>
    <script type="text/javascript" src="../Scripts/iepngfix_tilebg.js"></script>
    <style>
        .IE6png
        {
            behavior: url("../Scripts/iepngfix.htc");
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <input id="hdAreaCode" type="hidden" runat="server" value="" />
    <input id="hdEmpGuid" type="hidden" runat="server" value="" />
    <input type="hidden" id="hdCorpGuid" runat="server" value="" />
    <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td width="16" class="title_lbg IE6png">
            </td>
            <td width="24" class="title_t IE6png">
            </td>
            <td width="713" class="title_libg IE6png">
                人员审核
            </td>
            <td width="17" class="title_rbg IE6png">
            </td>
        </tr>
        <tr>
            <td class="border_lbg IE6png">
                &nbsp;
            </td>
            <td colspan="2">
                <div id="con">
                    <ul id="tags">
                        <li class="selectTag"><a href="#">人员审核</a> </li>
                    </ul>
                    <div id="tagContent">
                        <div class="tagContent selectTag">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="xx_tab">
                                <tr>
                                    <td align="right">
                                        审核结果
                                        <input id="hdID" type="hidden" runat="server" value="0" control="ID" />
                                    </td>
                                    <td>
                                        <div class="s_input">
                                            <span class="input_l">
                                                <img src="../images/input_l.jpg" width="10" height="31" alt="" />
                                            </span>
                                            <span class="input_mm">
                                                <select id="DropAudit" style="width: 205px; height: 20px; line-height: 31px; margin-top: 5px;
                                                    border: 0;">
                                                    <option value="5">通过</option>
                                                    <option value="6">退回</option>
                                                </select>
                                            </span> 
                                            <span class="input_r">
                                                <img src="../images/input_r.jpg" width="10" height="31" alt="" />
                                            </span>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        审核意见
                                    </td>
                                    <td>
                                        <div class="text_input">
                                            <span class="input_l">
                                                <img src="../images/text_l.jpg" width="10" height="81" alt="" />
                                            </span>
                                            <span class="text_m">
                                                <textarea id="txtContext" cols="220" rows="4" style="width: 628px; height: 70px;
                                                    margin-top: 5px; border: 0;"></textarea>
                                            </span>
                                            <span class="input_r">
                                                <img src="../images/text_r.jpg" width="10" height="81" alt="" />
                                            </span>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <table height="80" border="0" align="center" cellpadding="0" cellspacing="0" class="xx_tab">
                                <tr>
                                    <td width="144" height="80">
                                        <div class="icon01 IE6png">
                                            <a id="btnSave" href="javascript:void(0);">保存</a>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </td>
            <td class="border_rbg IE6png">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="border_lconer IE6png" headers="17">
                &nbsp;
            </td>
            <td colspan="2" class="border_bottomli IE6png" height="17">
                &nbsp;
            </td>
            <td class="border_rconer IE6png" headers="17">
                &nbsp;
            </td>
        </tr>
    </table>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="Manager1" runat="server" EnableShadow="true" Skin="WebBlue">
    </telerik:RadWindowManager>
    </form>
</body>
</html>
<script type="text/javascript">
    /*人员审核退回*/
    var optType;
    var empGuid;
    var corpGuid;
    var areaCode;
    var optTypeStr;
    var appId;
    $(function () {
        optType = 5;
        empGuid = $("#<%=hdEmpGuid.ClientID %>").val();
        corpGuid = $("#<%=hdCorpGuid.ClientID %>").val();
        areaCode = $("#<%=hdAreaCode.ClientID %>").val();
        optTypeStr = "主管审核";
        appId = "<%=AppId %>";
        Initial();
    });

    //初始化页面
    function Initial() {
        $("#btnSave").click(function () {
            CheckAudit();
        });

        if (appId == "95"){
            $("#DropAudit").append("<option value='51'>有条件通过</option>")
        }
    }

    //审核
    function CheckAudit() {
        optType = $("#DropAudit").val();
        var flag = 1;
        if (appId == "95" && /^(5|51)$/.test(optType)) {
            flag = 0;
        }
        if (flag > 0) {
            if ($("#txtContext").val() == "") {
                OpenAlert("请添加审核意见！");
                $("#txtContext").focus();
                return false;
            }
        }
        if ($("#txtContext").val().length > 200) {
            OpenAlert("审核意见内容过长！");
            $("#txtContext").select();
            return false;
        }
        var massage = '请确定要审核人员信息？';
        if (optType == 6) {
            optTypeStr = "主管退回";
            massage = '请确定要退回人员信息？';
        }
        OpenConfirm(massage, confirmCallBackFnAudit);
        return false;
    }
    //审核执行事件
    function confirmCallBackFnAudit(arg) {
        if (arg) {
            var parmer = {};
            parmer.action = "EmpPost";
            parmer.empGuid = empGuid;
            parmer.corpGuid = corpGuid;
            parmer.areaCode = areaCode;
            parmer.message = optTypeStr;
            parmer.optType = optType;
            parmer.descr = $("#txtContext").val(); ;
            parmer.rand = Math.random();
            $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", parmer, function (data) {

                if (data.Result) {
                    OpenAlertFn1(data.Message);
                } else {
                    OpenAlert(data.Message);
                }
            });
        }
    }
    /*关闭窗口*/

    function returnToParent(result) {
        var oArg = { childWinName: "Audit", Result: result };
        parent.OnClientClose2(oArg);
        window.parent.$.ligerDialog.close(); //关闭dialog
        parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
    }
    function OpenAlert(text) {
        $.ligerDialog.warn(text);
        return false;
    }
    function OpenAlertFn1(text) {
        $.ligerDialog.warn(text, '', alertCallBackFn1);
        return false;
    }
    function OpenConfirm(text, confirmCallBackFn) {
        $.ligerDialog.confirm(text, '', confirmCallBackFn);
        return false;
    }
    function alertCallBackFn1(arg) {
        returnToParent(0);
    } 
</script>
